using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class MP : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (GetTogether.Studio.Config.Original.EnableLogin
            && Request.Url.AbsolutePath.ToLower().IndexOf("login.aspx") < 0
            && Request.Url.AbsolutePath.ToLower().IndexOf("viewer.aspx") < 0
            && Request.Url.ToString().IndexOf("from-schedule") < 0
            && string.IsNullOrEmpty(GetTogether.Studio.SessionHelper.GetCurrentSession().SignUsername))
        {
            System.Web.HttpContext.Current.Session.Abandon();
            Response.Redirect(string.Concat("~/Login.aspx?auto-sign=1&auto-sign-url=", System.Web.HttpUtility.UrlEncode(Request.Url.PathAndQuery)));
        }
    }
}
